package com.d0326;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class HashSetTest {
    public static void main(String[] args) {
        Set<Student> set =  new HashSet<>();

        Student stu1 = new Student("Jack",21,98);

        set.add(stu1);

        System.out.println("个数"+set.size());
        for (Student stu:
             set) {
            System.out.println(stu);

            Iterator<Student> iterator = set.iterator();
            while (iterator.hasNext()){
                Student student = iterator.next();
                System.out.println(student);
            }
        }

    }
}
